A solar lamp is an electric lamp using electric energy generated by a solar battery panel converting solar energy into electricity. During the daytime, even on a cloudy day, the solar panel can also collect and store solar energy. The solar lamp, as a new, safe and environment-friendly lamp, has received more and more attention. Solar lamps on the market are mounted mostly in a fixed manner, and thus are inconvenient to dismount when replacement is needed. In terms of illumination, most of solar lamps on the market are of permanent illumination, namely, using a button to realize switch-on and switch-off. If the solar lamps are not switched off in time, permanent illumination is also a waste in terms of resource costs.